package com.hdax.dm.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CommonResponse<T> {

    private static final String SUCCESS = "success";
    private static final String ERRORCODE = "0000";

    private String success;
    private String errorCode;
    private String msg;
    private T data;

    public CommonResponse(T data,String msg){
        this.data = data;
        this.msg = msg;
        this.success = SUCCESS;
        this.errorCode = ERRORCODE;
    }

    public CommonResponse(String errorCode,String msg){
        this.msg = msg;
        this.errorCode = errorCode;
    }

}
